
from chaotic import chaotic
from mbg import join, bottom, top, assign, iota

succ = {1: set([2]),
        2: set([3,4]),
        3: set([4]),
        4: set()
        }

tr = {(1,2): lambda ng: assign(ng, 'x', ('5', ())),
      (2,3): lambda ng: ng,
      (2,4): lambda ng: ng,
      (3,4): lambda ng: assign(ng, 'y', ('6', ())),
      }

tr_txt = {(1,2): "x = 5;",
          (2,3): "if (x == 5) (then)",
          (3,4): "y = 6;",
          (2,4): "if (x == 5) (else)",
          }

chaotic(succ, 1, iota, join, bottom, tr, tr_txt, "ng_prog3.png")

#1. x = 5;
#2. if (x == 5):
#3.    y = 6;